﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class MenuConfig : ActiveRecordBase<MenuConfig>
    {
		#region Const Definition
		
		public const string CONST_MenuID								= "MenuID";
		public const string CONST_MenuTitle								= "MenuTitle";
		public const string CONST_MenuTitle_CN							= "MenuTitle_CN";
		public const string CONST_MenuURL								= "MenuURL";
		public const string CONST_ParentMenuID							= "ParentMenuID";
		public const string CONST_MenuSequenceID						= "MenuSequenceID";
		public const string CONST_IsEnabled								= "IsEnabled";
		public const string CONST_Target								= "Target";
		public const string CONST_MenuGroup								= "MenuGroup";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _menuID;
        
        // Non Key
        private System.String _menuTitle;
        private System.String _menuTitle_CN;
        private System.String _menuURL;
        private Nullables.NullableInt32 _parentMenuID;
        private Nullables.NullableInt32 _menuSequenceID;
        private System.Boolean _isEnabled;
        private System.String _target;
        private System.String _menuGroup;

        // Parents
        
        
		

        #endregion

        public MenuConfig() {
               
        }
        public MenuConfig(
            System.String menuTitle
            ,System.String menuTitle_CN
            ,System.String menuURL
            ,Nullables.NullableInt32 parentMenuID
            ,Nullables.NullableInt32 menuSequenceID
            ,System.Boolean isEnabled
            ,System.String target
            ,System.String menuGroup) : this() {
                
            this._menuTitle = menuTitle; 
            this._menuTitle_CN = menuTitle_CN; 
            this._menuURL = menuURL; 
            this._parentMenuID = parentMenuID; 
            this._menuSequenceID = menuSequenceID; 
            this._isEnabled = isEnabled; 
            this._target = target; 
            this._menuGroup = menuGroup; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_MENUCONFIG_MENUID")]
		#endif
        public System.Int32 MenuID {
            get { return this._menuID; }
            set {  this._menuID = value; }
        }
        
        // Non Key
        [Property]
        public System.String MenuTitle {
            get { return this._menuTitle; }
			set { if (value == null) return; if (value.Length > 200) this._menuTitle = value.Substring(0,200); else this._menuTitle = value; }	
        }
        
        [Property]
        public System.String MenuTitle_CN {
            get { return this._menuTitle_CN; }
			set { if (value == null) return; if (value.Length > 500) this._menuTitle_CN = value.Substring(0,500); else this._menuTitle_CN = value; }	
        }
        
        [Property]
        public System.String MenuURL {
            get { return this._menuURL; }
			set { if (value == null) return; if (value.Length > 200) this._menuURL = value.Substring(0,200); else this._menuURL = value; }	
        }
        
        [Property]
        public Nullables.NullableInt32 ParentMenuID {
            get { return this._parentMenuID; }
			set { this._parentMenuID = value; }
        }
        
        [Property]
        public Nullables.NullableInt32 MenuSequenceID {
            get { return this._menuSequenceID; }
			set { this._menuSequenceID = value; }
        }
        
        [Property]
        public System.Boolean IsEnabled {
            get { return this._isEnabled; }
			set { this._isEnabled = value; }
        }
        
        [Property]
        public System.String Target {
            get { return this._target; }
			set { if (value == null) return; if (value.Length > 50) this._target = value.Substring(0,50); else this._target = value; }	
        }
        
        [Property]
        public System.String MenuGroup {
            get { return this._menuGroup; }
			set { if (value == null) return; if (value.Length > 100) this._menuGroup = value.Substring(0,100); else this._menuGroup = value; }	
        }
        
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public MenuConfig Clone()
		{
			MenuConfig newMenuConfig = new MenuConfig();
			
            newMenuConfig.MenuTitle = this._menuTitle; 
            newMenuConfig.MenuTitle_CN = this._menuTitle_CN; 
            newMenuConfig.MenuURL = this._menuURL; 
            newMenuConfig.ParentMenuID = this._parentMenuID; 
            newMenuConfig.MenuSequenceID = this._menuSequenceID; 
            newMenuConfig.IsEnabled = this._isEnabled; 
            newMenuConfig.Target = this._target; 
            newMenuConfig.MenuGroup = this._menuGroup; 
			return newMenuConfig;
		}
    }
}



